import React, { memo,useEffect } from "react";
import { useDispatch } from "react-redux";

import "./index.scss";
import rankActions from "store/action/rank";
import WYTopRanking from "./c-cpns/top-ranking";
import WYRankingHeader from "./c-cpns/ranking-header";
import WYRankingList from "./c-cpns/ranking-list";

export default memo(function WYRanking() {
  // 一来就拿到榜单数据 
  const dispatch = useDispatch()
  useEffect(() => {
      dispatch(rankActions.getTopList())
  }, [dispatch])

  return (
    <div className="wy-ranking wrap-v2">
      <div className="rank-l">
        <WYTopRanking />
      </div>
      <div className="rank-r">
        <WYRankingHeader/>
        <WYRankingList/>
      </div>
    </div>
  );
});
